const fs = require('fs')

let p = new Promise((resolve,reject) => {
    fs.readFile('./resiurce/fs.txt' ,(err,data) => {
        // 如果出错
        if(err) reject(err)
        // 如果成功
        resolve(data)
    })
})

p.then(value => {
    console.log(value.toString())
}, reason => {
    console.log(reason)
})